package com.e2oto.seller.modules.seller.ui;


import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.e2oto.seller.R;
import com.e2oto.seller.common.base.BaseMvpFragment;
import com.e2oto.seller.common.utils.ToastUtils;
import com.e2oto.seller.modules.seller.bean.RxBusBean;
import com.e2oto.seller.modules.seller.presenter.MinePresenter;
import com.e2oto.seller.modules.seller.views.MineView;
import com.e2oto.seller.widget.RatingBar;

import butterknife.BindView;
import butterknife.OnClick;


/**
 * Created by ZhangLiQiang on 2017/9/11.
 */

public class MineFragment extends BaseMvpFragment<MineView, MinePresenter> implements MineView {


    @BindView(R.id.mine_rating_bar)
    RatingBar ratingBar;
    @BindView(R.id.mine_shop_logo)
    ImageView shopLogoIv;
    @BindView(R.id.mine_shop_name)
    TextView shopNameTv;
    @BindView(R.id.mine_shop_business_hour)
    TextView shopBussinesHourTv;
    @BindView(R.id.mine_shop_description)
    TextView shopDescriptionTv;

    @Override
    protected int getContentView() {
        return R.layout.fragment_mine;
    }

    @Override
    public MinePresenter createPresenter() {
        return new MinePresenter();
    }

    @Override
    protected void onFragmentFirstVisible() {
        super.onFragmentFirstVisible();
        ratingBar.setStarMark(4.5f);
    }

    @Override
    protected void onReceiveRxMessage(RxBusBean anyType) {
        super.onReceiveRxMessage(anyType);
    }

    @Override
    public void showMessage(String msg) {
        ToastUtils.INSTANCE.showToast(getActivity(), msg);
    }


    @OnClick({R.id.mine_shop_info, R.id.mine_shop_notice, R.id.mine_break_shop, R.id.mine_shop_close})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.mine_shop_info:
                startActivity(new Intent(getActivity(), ShopInfoActivity.class));
                break;
            case R.id.mine_shop_notice:
                startActivity(new Intent(getActivity(), ShopNoticeActivity.class));
                break;
            case R.id.mine_shop_close://打烊                                                                                                                                                                                                                                 ://打烊

                break;
            case R.id.mine_break_shop://关店
                startActivity(new Intent(getActivity(), ShopCloseActivity.class));
                break;
        }
    }

}
